/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * supervision_rh_prenomina_agregar.java
 *
 * Created on 9/01/2012, 11:47:09 AM
 */

package si_rhnominafacil;


import java.sql.*;
import java.util.logging.Logger;
import javax.swing.*;
import java.awt.*;
import java.awt.print.PrinterException;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.Calendar;

import java.text.ParseException;
import java.text.*;
import java.util.logging.Level;
/**
 *
 * @author Michelle
 */
public class rh_empleados_prenomina_agregar extends javax.swing.JFrame {

    private javax.swing.table.DefaultTableModel jtable_modelo_detalleprenomina;
    private javax.swing.table.DefaultTableModel jtable_modelo_detallepreinterno;
    private javax.swing.table.DefaultTableModel jtable_modelo_detallepreinternoobs;
    private javax.swing.table.DefaultTableModel jtable_modelo_detalledistri_intupdate;
    private javax.swing.table.DefaultTableModel jtable_modelo_historialresumen;
    private javax.swing.table.DefaultTableModel jtable_modelo_historialpuntualidad;

    private javax.swing.table.DefaultTableModel jtable_modelo_asistenciaxdia;

    private javax.swing.table.DefaultTableModel jtable_modelo_empleado;
    private DefaultListModel modelo ;
    si_conectar x = new si_conectar();
    ResultSet rs = null;


    int fempleadoactual=0, fpreguntaactual=0,fpuestoactual=0,findicadoractual,opcioncatalogo=2,controlcomboasi=0,combobusqueda=0,lugar=1;
    private SimpleDateFormat formateador = new SimpleDateFormat("dd-MM-yyyy");
    private SimpleDateFormat formateadoresta = new SimpleDateFormat("yyyy-MM-dd");
    String textobuscaemplea="";
    /** Creates new form supervision_rh_prenomina_agregar */
    public rh_empleados_prenomina_agregar() {
        this.iniciar_modelo_detalleprenomina();
        this.iniciar_modelo_detallepreinterno();
        this.iniciar_modelo_distribucion_controlintupdate();
        this.iniciar_modelo_asistencia();
        this.iniciar_modelo_distribucion_controlintobs();
        this.iniciar_modelo_empleado();
        this.iniciar_modelo_historialresumen();
        this.iniciar_modelo_historialpuntualidad();
        initComponents();
         java.util.Date fecha=new Date();
         this.jdc_fechadocto.setDate(fecha);

        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 1);
        this.jdc_fechainicio.setDate(fechaini.getTime());
        fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 15);
        this.jdc_rangofinal.setDate(fechaini.getTime());

         this.loadcombodepa();
         this. loadcombo_periodos();
         controlcomboasi=1;
         
         this.jdc_insidenciasini.setDate(fecha);
         this.jdc_insidenciasfin.setDate(fecha);


        jt_catempleados.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_catempleados.getColumnModel().getColumn(1).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_catempleados.getColumnModel().getColumn(3).setPreferredWidth(120);//tem ent
        jt_catempleados.getColumnModel().getColumn(4).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(5).setPreferredWidth(40);//subfam.
        jt_catempleados.getColumnModel().getColumn(6).setPreferredWidth(60);//tem ent

           jt_detalleprenomina.getColumnModel().getColumn(0).setPreferredWidth(50);//tem ent
        jt_detalleprenomina.getColumnModel().getColumn(1).setPreferredWidth(120);//familia



        jt_historialasistencia.getColumnModel().getColumn(0).setPreferredWidth(65);//fecha
        jt_historialasistencia.getColumnModel().getColumn(1).setPreferredWidth(50);//status.
        jt_historialasistencia.getColumnModel().getColumn(2).setPreferredWidth(10);//hora e
        jt_historialasistencia.getColumnModel().getColumn(3).setPreferredWidth(10);//hora s
        jt_historialasistencia.getColumnModel().getColumn(4).setPreferredWidth(35);//Minutos.
        jt_historialasistencia.getColumnModel().getColumn(5).setPreferredWidth(15);//Horas t
        jt_historialasistencia.getColumnModel().getColumn(6).setPreferredWidth(45);//Puntualidad


       jt_resumenhistorial.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
        jt_resumenhistorial.getColumnModel().getColumn(1).setPreferredWidth(35);//status.

        jt_resumenhistorialpuntual.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
       jt_resumenhistorialpuntual.getColumnModel().getColumn(1).setPreferredWidth(35);//status.



        this.buttonGroup1.setSelected(jrb_bdescrip.getModel(),true);
        combobusqueda=1;


    }

       public rh_empleados_prenomina_agregar(String idperiodo,String periodo) {
        this.iniciar_modelo_detalleprenomina();
        this.iniciar_modelo_detallepreinterno();
        this.iniciar_modelo_distribucion_controlintupdate();
        this.iniciar_modelo_asistencia();
        this.iniciar_modelo_distribucion_controlintobs();
        this.iniciar_modelo_empleado();
       this.iniciar_modelo_historialresumen();
         this.iniciar_modelo_historialpuntualidad();
        initComponents();
         java.util.Date fecha=new Date();
         this.jdc_fechadocto.setDate(fecha);

        Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 1);
        this.jdc_fechainicio.setDate(fechaini.getTime());
        fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 15);
        this.jdc_rangofinal.setDate(fechaini.getTime());

    
        this.jcmbox_idperiodo.addItem(idperiodo+":"+periodo);

         this.loadcombodepa();
         this. loadcombo_periodos();
         controlcomboasi=1;

         this.jdc_insidenciasini.setDate(fecha);
         this.jdc_insidenciasfin.setDate(fecha);

        this.carga_datos_periodos(5,idperiodo);

        jt_catempleados.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_catempleados.getColumnModel().getColumn(1).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_catempleados.getColumnModel().getColumn(3).setPreferredWidth(120);//tem ent
        jt_catempleados.getColumnModel().getColumn(4).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(5).setPreferredWidth(40);//subfam.
        jt_catempleados.getColumnModel().getColumn(6).setPreferredWidth(60);//tem ent

           jt_detalleprenomina.getColumnModel().getColumn(0).setPreferredWidth(50);//tem ent
        jt_detalleprenomina.getColumnModel().getColumn(1).setPreferredWidth(120);//familia



        jt_historialasistencia.getColumnModel().getColumn(0).setPreferredWidth(65);//fecha
        jt_historialasistencia.getColumnModel().getColumn(1).setPreferredWidth(50);//status.
        jt_historialasistencia.getColumnModel().getColumn(2).setPreferredWidth(10);//hora e
        jt_historialasistencia.getColumnModel().getColumn(3).setPreferredWidth(10);//hora s
        jt_historialasistencia.getColumnModel().getColumn(4).setPreferredWidth(35);//Minutos.
        jt_historialasistencia.getColumnModel().getColumn(5).setPreferredWidth(15);//Horas t
        jt_historialasistencia.getColumnModel().getColumn(6).setPreferredWidth(45);//Puntualidad



       jt_resumenhistorial.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
        jt_resumenhistorial.getColumnModel().getColumn(1).setPreferredWidth(35);//status.

        jt_resumenhistorialpuntual.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
       jt_resumenhistorialpuntual.getColumnModel().getColumn(1).setPreferredWidth(35);//status.

               this.buttonGroup1.setSelected(jrb_bdescrip.getModel(),true);
combobusqueda=1;
 lugar=2;

    }

      public rh_empleados_prenomina_agregar(String id,String departamento,String periodo) {
        this.iniciar_modelo_detalleprenomina();
        this.iniciar_modelo_detallepreinterno();
        this.iniciar_modelo_distribucion_controlintupdate();
        this.iniciar_modelo_asistencia();
        this.iniciar_modelo_distribucion_controlintobs();
        this.iniciar_modelo_empleado();
       this.iniciar_modelo_historialresumen();
         this.iniciar_modelo_historialpuntualidad();
        initComponents();
         java.util.Date fecha=new Date();
         this.jdc_fechadocto.setDate(fecha);

        //Calendar fechaini = Calendar.getInstance(); // obtiene la fecha actual
        //fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 1);
        //this.jdc_fechainicio.setDate(fechaini.getTime());
        //fechaini.set(fecha.getYear()+1900,fecha.getMonth(), 15);
        //this.jdc_rangofinal.setDate(fechaini.getTime());

           this.jcmbox_idperiodo.addItem(id+":"+periodo);
        

        // this.jdc_insidenciasini.setDate(fecha);
        // this.jdc_insidenciasfin.setDate(fecha);
        this.carga_datos_periodos(5,id);

        jt_catempleados.getColumnModel().getColumn(0).setPreferredWidth(30);//tem ent
        jt_catempleados.getColumnModel().getColumn(1).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(2).setPreferredWidth(60);//subfam.
        jt_catempleados.getColumnModel().getColumn(3).setPreferredWidth(120);//tem ent
        jt_catempleados.getColumnModel().getColumn(4).setPreferredWidth(80);//familia
        jt_catempleados.getColumnModel().getColumn(5).setPreferredWidth(40);//subfam.
        jt_catempleados.getColumnModel().getColumn(6).setPreferredWidth(60);//tem ent

        jt_detalleprenomina.getColumnModel().getColumn(0).setPreferredWidth(50);//tem ent
        jt_detalleprenomina.getColumnModel().getColumn(1).setPreferredWidth(120);//familia



        jt_historialasistencia.getColumnModel().getColumn(0).setPreferredWidth(65);//fecha
        jt_historialasistencia.getColumnModel().getColumn(1).setPreferredWidth(50);//status.
        jt_historialasistencia.getColumnModel().getColumn(2).setPreferredWidth(10);//hora e
        jt_historialasistencia.getColumnModel().getColumn(3).setPreferredWidth(10);//hora s
        jt_historialasistencia.getColumnModel().getColumn(4).setPreferredWidth(35);//Minutos.
        jt_historialasistencia.getColumnModel().getColumn(5).setPreferredWidth(15);//Horas t
        jt_historialasistencia.getColumnModel().getColumn(6).setPreferredWidth(45);//Puntualidad


       jt_resumenhistorial.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
        jt_resumenhistorial.getColumnModel().getColumn(1).setPreferredWidth(35);//status.

        jt_resumenhistorialpuntual.getColumnModel().getColumn(0).setPreferredWidth(10);//fecha
       jt_resumenhistorialpuntual.getColumnModel().getColumn(1).setPreferredWidth(35);//status.

         this.buttonGroup1.setSelected(jrb_bdescrip.getModel(),true);
        String iddep[]=departamento.split(":");

         this.carga_datos_empleado(11, iddep[0]);
         //************PENDIENTE PORQUE NO SE QUE ESTABA TRABAJANDO*****
        //this.carga_datos_empleado_detalle_movreload(4, id,departamento);
        //this.crea_hojempleados_controlinternoupdate();

        this.jcmbox_depart.addItem(departamento);
        //this.jcmbox_idperiodo.addItem(periodo);
 
        
         this.loadcombodepa();
         this.loadcombo_periodos();
        controlcomboasi=1;
        combobusqueda=1;
        
   //this.carga_datos_prenomina(0,id);
         
    }


    private void iniciar_modelo_distribucion_controlintupdate()
    {
        jtable_modelo_detalledistri_intupdate=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalledistri_intupdate.addColumn("<html><b>Id P o D</b></html>");
        jtable_modelo_detalledistri_intupdate.addColumn("<html><b>id Empleado</b></html>");
        jtable_modelo_detalledistri_intupdate.addColumn("<html><b>cantidad</b></html>");
        jtable_modelo_detalledistri_intupdate.addColumn("<html><b>Empleado</b></html>");

    }
 private void iniciar_modelo_distribucion_controlintobs()
    {
        jtable_modelo_detallepreinternoobs=new javax.swing.table.DefaultTableModel();//Creo el modelo

        jtable_modelo_detallepreinternoobs.addColumn("<html><b>id Empleado</b></html>");
        jtable_modelo_detallepreinternoobs.addColumn("<html><b>Observacion</b></html>");
        jtable_modelo_detallepreinternoobs.addColumn("<html><b>Empleado</b></html>");
        jtable_modelo_detallepreinternoobs.addColumn("<html><b>Iddepto</b></html>");
        jtable_modelo_detallepreinternoobs.addColumn("<html><b>Idpatf</b></html>");
        jtable_modelo_detallepreinternoobs.addColumn("<html><b>Idpatnof</b></html>");
    }

private void iniciar_modelo_detalleprenomina()
    {
    modelo = new javax.swing.DefaultListModel();
        jtable_modelo_detalleprenomina=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detalleprenomina.addColumn("<html><b>Depto</b></html>");
        jtable_modelo_detalleprenomina.addColumn("<html><b>Nombre</b></html>");
        try
            {
              rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_prenomina_percepodeduc(1,'','','') as (id smallint,descrip text,tipopod smallint,observacion text,idpodf smallint,idpodnof smallint);",si_variables.getconexiongral());
               while (rs.next())
                    {
                      jtable_modelo_detalleprenomina.addColumn("<html><b>"+rs.getString("id")+":"+rs.getString("descrip")+"</b></html>");
                      modelo.addElement(rs.getString("id")+":"+rs.getString("descrip")+":"+rs.getString("idpodf")+":"+rs.getString("idpodnof"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
        jtable_modelo_detalleprenomina.addColumn("<html><b>Observacion</b></html>");
    }

private void iniciar_modelo_detallepreinterno()
    {
        jtable_modelo_detallepreinterno=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_detallepreinterno.addColumn("<html><b>Id</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>Nombre</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>Id p_o_d</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>Cantidad</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>id podf</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>id podnof</b></html>");
        jtable_modelo_detallepreinterno.addColumn("<html><b>patron</b></html>");
    }
private void iniciar_modelo_asistencia()
    {
        jtable_modelo_asistenciaxdia=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Fecha</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Status</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Hora E.</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Hora S.</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Min. Comida</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Hrs Trab.</b></html>");
        jtable_modelo_asistenciaxdia.addColumn("<html><b>Puntualidad</b></html>");
    }
private void iniciar_modelo_empleado()
    {
        jtable_modelo_empleado=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_empleado.addColumn("<html><b>Status</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>Dep.</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>Puesto</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>Nombre</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>Domicilio</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>telefono</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>email</b></html>");
        jtable_modelo_empleado.addColumn("<html><b>F.Ingreso</b></html>");
    }
private void iniciar_modelo_historialresumen()
    {
        jtable_modelo_historialresumen=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_historialresumen.addColumn("<html><b>Cant.</b></html>");
        jtable_modelo_historialresumen.addColumn("<html><b>Concepto</b></html>");

    }
private void iniciar_modelo_historialpuntualidad()
    {
        jtable_modelo_historialpuntualidad=new javax.swing.table.DefaultTableModel();//Creo el modelo
        jtable_modelo_historialpuntualidad.addColumn("<html><b>Cant.</b></html>");
       jtable_modelo_historialpuntualidad.addColumn("<html><b>Puntualidad</b></html>");

    }


private void loadcombodepa(){

            try
            {
                rs = x.sieuno_executediversosv2("select * from x1_supervision_tareas_departamentos() as (id smallint,descrip character varying(80));",si_variables.getconexiongral());
               while (rs.next())
                    {
                      this.jcmbox_depart.addItem(rs.getString("id")+":"+rs.getString("descrip"));

                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }
private void loadcombo_periodos(){
        this.jcmbox_idperiodo.addItem("0:ELEGIR PERIODO");
            try
            {
              rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_prenomina_periodos(1,'','','') as (id smallint,descrip text,obser text);",si_variables.getconexiongral());
               while (rs.next())
                    {
                      this.jcmbox_idperiodo.addItem(rs.getString("id")+":"+rs.getString("descrip"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }

private void carga_datos_prenomina(int opcion,String textobusca)
   {
       //invoco al metodo que trae el recordset de datos
       //voy por el detalle del documento

    java.util.Date fechaestaeuropa=null;
       try
           {
            rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_prenomina_doctos_catalogo("+opcion+",'"+textobusca+"','','') as (id integer,titulo text,fechaini date,fechafin date,iddepto smallint,idperiodo smallint,fechainii date,fechafini date,observ text,idstatus smallint,idsuperviso integer,fechadocto date,hora time,statusdescrip text,depadescrip character varying(80),periododesc text,supnombre character varying(50),superapp character varying(50),superapm character varying(50));",si_variables.getconexiongral());
            while (rs.next())
                {
                    this.jtf_tituloprenomina.setText(rs.getString("titulo"));
                    this.jtf_observaindica.setText(rs.getString("observ"));
                    if (rs.getString("fechaini")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechaini"));
                                    this.jdc_fechainicio.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                       if (rs.getString("fechafin")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechafin"));
                                    this.jdc_rangofinal.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                       if (rs.getString("fechainii")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechainii"));
                                    this.jdc_insidenciasini.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                        if (rs.getString("fechafini")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechafini"));
                                    this.jdc_insidenciasfin.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }

                }
           }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
    }


private void crea_hojempleadosaprenomina(String idempleado,String departamento,String nombre,String horaentrada,String horasalida,String stasis,int columna,String observacion,String fechaingreso,String idpat,String idpatnof,String diasl)
    {
        int numerofilas=this.jtable_modelo_detalleprenomina.getRowCount();
        String empleadoactual[]=null,iddepto[]=null;
        int numerocolumnas=jt_detalleprenomina.getColumnModel().getColumnCount(),ii=00,encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];

       //invoco al metodo que trae el recordset de datos
        for( ii=0;ii<numerofilas;ii++)
                {
                    empleadoactual=jtable_modelo_detalleprenomina.getValueAt(ii, 1).toString().split(":");
                     if (empleadoactual[0].equals(idempleado))
                        {
                            encontrado=1;
                        }
                }
       if(encontrado==0)
            {
                 fnewRow[0]=departamento;
                 fnewRow[1]=idempleado+":"+nombre+"("+fechaingreso+")";
                 if(Integer.valueOf(diasl)<Integer.valueOf(this.jtf_peridodias.getText().toString()))
                    fnewRow[2]=diasl;
                 else
                    fnewRow[2]=this.jtf_peridodias.getText().toString();
                 for(ii=3;ii<numerocolumnas;ii++)
                            {
         
                                        fnewRow[ii]="0";
                             }
                 fnewRow[numerocolumnas-1]=".";
          jtable_modelo_detalleprenomina.addRow(fnewRow);
          iddepto=departamento.split(":");
          jtable_modelo_detallepreinternoobs.addRow(new Object[]{idempleado,".",nombre,iddepto[0],idpat,idpatnof});
          int elementos=this.jlst_clientesdistribucion.getModel().getSize();
          String tiendas[]=null;
          for(int j = 0 ;j < elementos ; j++)
                {
                    this.jlst_clientesdistribucion.setSelectedIndex(j);
                    tiendas=this.jlst_clientesdistribucion.getSelectedValue().toString().split(":");
                    jtable_modelo_detallepreinterno.addRow(new Object[]{idempleado,nombre,tiendas[0],"0",tiendas[2],tiendas[3],idpat});
                 }
            }
    }
private void crea_hojempleados_controlinternoupdate()
    {
        int numerofilas=this.jtable_modelo_detalleprenomina.getRowCount(),numerocolumnas=jt_detalleprenomina.getColumnModel().getColumnCount(),ii=00,filasci=this.jtable_modelo_detallepreinterno.getRowCount(),i=0,ici=0,filasciobs=this.jtable_modelo_detallepreinternoobs.getRowCount();

        String empleadoactual="",idpod="",idempleado[]=null, columtitulo[]=null;

       //invoco al metodo que trae el recordset de datos
         for( ii=2;ii<numerocolumnas;ii++)
            {
            for(i=0;i<numerofilas;i++)
                    {
                        idempleado=jtable_modelo_detalleprenomina.getValueAt(i, 1).toString().split(":");
                         columtitulo= jtable_modelo_detalleprenomina.getColumnName(ii).replace("<html><b>","").replace("</b></html>","").split(":");
                          for( ici=0;ici<filasci;ici++)
                                 {
                                 empleadoactual=jtable_modelo_detallepreinterno.getValueAt(ici, 0).toString();
                                 idpod=jtable_modelo_detallepreinterno.getValueAt(ici, 2).toString();
                                     if ((empleadoactual.equals(idempleado[0])) && (idpod.equals(columtitulo[0])))
                                         {
                                             jtable_modelo_detallepreinterno.setValueAt(jtable_modelo_detalleprenomina.getValueAt(i, ii).toString(),ici,3);
                                        }
                                 System.out.println("concepto:"+columtitulo[0]+" Empleado:"+idempleado[0]+" empleado busqueda:"+empleadoactual+" id pod:"+idpod);
                                 }
                    }

            }

         for(i=0;i<numerofilas;i++)
                    {
                        idempleado=jtable_modelo_detalleprenomina.getValueAt(i, 1).toString().split(":");
                          for( ici=0;ici<filasciobs;ici++)
                                 {
                                 empleadoactual=jtable_modelo_detallepreinternoobs.getValueAt(ici, 0).toString();
                                     if (empleadoactual.equals(idempleado[0]))
                                         {
                                             jtable_modelo_detallepreinternoobs.setValueAt(jtable_modelo_detalleprenomina.getValueAt(i, numerocolumnas-1).toString().toUpperCase().replace(".", "")+".",ici,1);
                                        }
                                 System.out.println("concepto:"+columtitulo[0]+" Empleado:"+idempleado[0]+" empleado busqueda:"+empleadoactual+" id pod:"+idpod);
                                     }
                    }


    }
private void carga_datos_empleado(int opcion,String textobusca)
   {
       //invoco al metodo que trae el recordset de datos
       //voy por el detalle del documento

       Object[] fnewRow = new Object[8];
       try
           {
            rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_catalogo("+opcion+",'"+textobusca+"','','','') as (id integer,nombre text,id_depart smallint,fecha_alta date,descri_depa character varying(80),idpat smallint,idpatnof smallint,diasl integer);",si_variables.getconexiongral());
            while (rs.next())
                {
                             this.crea_hojempleadosaprenomina(rs.getString("id"), rs.getString("id_depart")+":"+rs.getString("descri_depa"),rs.getString("nombre"),"","","",2,"",this.fechaeuropea(rs.getString("fecha_alta")),rs.getString("idpat"),rs.getString("idpatnof"),rs.getString("diasl"));
                }
           }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
    }

private void carga_datos_asistencia(int opcion,String busca1,String busca2,String busca3)
    {
    //invoco al metodo que trae el recordset de datos
    int encontro=0,minutos=0;
      DecimalFormat myFormat2 = new DecimalFormat("############");
    String abrehtml="",cierrahtml="",texto="select * from x1_supervision_empleados_asistencia_catalogo("+opcion+",'"+busca1+"','"+busca2+"','"+busca3+"') as (id integer,fechaasiste date,idempleado integer,horaentrada time,horasalida time,idstatus smallint,observaciones text,iddepartamento smallint,idstatusconfirma smallint,nombreempleado character varying(50),nombrepat character varying(50),nombremat character varying(50),statusdescribe text,describedepa character varying(80),statusconfirmacion text,horastrab interval,mincomida interval,idpuntual smallint,despun text);",tiempo[]=null;
    while(jtable_modelo_asistenciaxdia.getRowCount()>0)jtable_modelo_asistenciaxdia.removeRow(0);
     Object[] fnewRow = new Object[7];
     System.out.println(texto);
    try
        {
         rs = x.sieuno_executediversosv2(texto,si_variables.getconexiongral());
            while (rs.next())
                {
                      switch (rs.getInt("idstatus"))
                        {

                            case 0:
                                abrehtml="<html><b><font color=#CC0000>";
                                cierrahtml="<font></b></html>";
                            break;
                            case 3:
                                abrehtml="<html><b><font color=#0000FF>";
                                cierrahtml="<font></b></html>";
                            break;
                            case 6:
                                abrehtml="<html><b><font color=#238E23>";
                                cierrahtml="<font></b></html>";
                            break;

                            default:
                                 abrehtml="<html>";
                                 cierrahtml="</html>";
                            break;
                        }
                    //fnewRow[0]=rs.getString("nombreempleado")+" "+rs.getString("nombrepat");
                    fnewRow[0]=abrehtml+this.fechaeuropea(rs.getString("fechaasiste"))+" "+this.DiaSemana(this.fechaeuropea(rs.getString("fechaasiste"))).substring(0, 3)+cierrahtml;
                    
                    fnewRow[1]=abrehtml+rs.getString("idstatus")+":"+rs.getString("statusdescribe")+cierrahtml;
                    fnewRow[2]=abrehtml+rs.getString("horaentrada").substring(0,5)+cierrahtml;
                    fnewRow[3]=abrehtml+rs.getString("horasalida").substring(0,5)+cierrahtml;
                    if((rs.getString("horastrab")!=null)&&(!rs.getString("horasalida").substring(0, 5).equals("00:00")))
                    {
                        tiempo=rs.getString("mincomida").split(":");
                        minutos=(Integer.valueOf(tiempo[0])*60)+(Integer.valueOf(tiempo[1]));
                        fnewRow[4]=abrehtml+myFormat2.format(minutos)+cierrahtml;
                        fnewRow[5]=abrehtml+rs.getString("horastrab").substring(0,5)+cierrahtml;
                    }
                    else
                    {
                         fnewRow[4]="";
                         fnewRow[5]="";
                    }
                    //fnewRow[7]=abrehtml+rs.getString("observaciones")+cierrahtml;
                    //fnewRow[8]=abrehtml+rs.getString("idstatusconfirma")+":"+rs.getString("statusconfirmacion")+cierrahtml;
                    //fnewRow[9]=abrehtml+rs.getString("id")+cierrahtml;
                    fnewRow[6]=abrehtml+rs.getString("despun")+cierrahtml;

                    jtable_modelo_asistenciaxdia.addRow(fnewRow);
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

     while(jtable_modelo_historialresumen.getRowCount()>0)jtable_modelo_historialresumen.removeRow(0);
     texto="select * from x1_supervision_empleados_asistencia_catalogo(15,'"+busca1+"','"+busca2+"','"+busca3+"') as (id smallint,descrip text,cantidad bigint);";
        try
        {
         rs = x.sieuno_executediversosv2(texto,si_variables.getconexiongral());
            while (rs.next())
                {
                    jtable_modelo_historialresumen.addRow(new Object[]{rs.getString("cantidad"),rs.getString("id")+":"+rs.getString("descrip")});
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }

      while(jtable_modelo_historialpuntualidad.getRowCount()>0)jtable_modelo_historialpuntualidad.removeRow(0);
     texto="select * from x1_supervision_empleados_asistencia_catalogo(16,'"+busca1+"','"+busca2+"','"+busca3+"') as (id smallint,descrip text,cantidad bigint);";
        try
        {
         rs = x.sieuno_executediversosv2(texto,si_variables.getconexiongral());
            while (rs.next())
                {
                    jtable_modelo_historialpuntualidad.addRow(new Object[]{rs.getString("cantidad"),rs.getString("id")+":"+rs.getString("descrip")});
                }
        }
        catch(Exception e)
        {
            System.out.println(e.getMessage());
        }



      }

 private void carga_datos_periodos(int opcion,String busqueda)
     {
          java.util.Date fechaestaeuropa=null;
            try
            {
              rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_prenomina_periodos("+opcion+",'"+busqueda+"','','') as (id smallint,descrip text,obser text,fechai date,fechaf date,dias integer,fini_insi date,ffin_insi date);",si_variables.getconexiongral());
               while (rs.next())
                    {
                        if (rs.getString("fechai")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechai"));
                                    this.jdc_fechainicio.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                       if (rs.getString("fechaf")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fechaf"));
                                    this.jdc_rangofinal.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                       if (rs.getString("fini_insi")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("fini_insi"));
                                    this.jdc_insidenciasini.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                        if (rs.getString("ffin_insi")!= null)
                        {
                            try
                                {
                                    fechaestaeuropa = formateadoresta.parse(rs.getString("ffin_insi"));
                                    this.jdc_insidenciasfin.setDate(fechaestaeuropa);
                                }
                            catch (ParseException e)
                                {
                                //Error, la cadena de texto no se puede convertir en fecha.
                                }
                        }
                        
                       this.jtf_peridodias.setText(rs.getString("dias"));
                    }
             }
            catch(Exception e)
            {
                System.out.println(e.getMessage());
            }
    }


private void documento_guardar(int opcion)
    {

        String arreglo_iddepto[]=this.jcmbox_depart.getSelectedItem().toString().split(":");
        String arreglo_idperiodo[]=this.jcmbox_idperiodo.getSelectedItem().toString().split(":");
        if(JOptionPane.showConfirmDialog(null, "Documento sera Guardado. Estan correcto sus Datos?")==0)
                    {
                    //this.quitardescripcion();
                     java.util.Vector arreglodeart_dis=this.jtable_modelo_detallepreinterno.getDataVector();
                    String articulos_papostgresqld=arreglodeart_dis.toString();
                    articulos_papostgresqld=articulos_papostgresqld.replace('[','{');
                    articulos_papostgresqld=articulos_papostgresqld.replace(']','}');
                    articulos_papostgresqld=articulos_papostgresqld.replace("null",".");

                    java.util.Vector arreglodearticulos=this.jtable_modelo_detallepreinternoobs.getDataVector();
                    String articulos_papostgresql=arreglodearticulos.toString();
                    articulos_papostgresql=articulos_papostgresql.replace('[','{');
                    articulos_papostgresql=articulos_papostgresql.replace(']','}');
                    articulos_papostgresql=articulos_papostgresql.replace("null",".");
        

                    String texto="select * from x1_supervision_empleados_prenomina_doctos_insert("+opcion+",'"+this.jtf_tituloprenomina.getText().toUpperCase().trim()+"','"+this.fechaamericana(this.jdc_fechainicio.getDate())+"','"+this.fechaamericana(this.jdc_rangofinal.getDate())+"','"+arreglo_iddepto[0]+"','"+arreglo_idperiodo[0]+"','"+this.fechaamericana(this.jdc_insidenciasini.getDate())+"','"+this.fechaamericana(this.jdc_insidenciasfin.getDate())+"','"+this.jtf_observaindica.getText().toUpperCase()+"','"+"1"+"','"+si_variables.getId_empleado()+"','"+articulos_papostgresqld+"','"+articulos_papostgresql+"')";
                    System.out.println(texto);
                    try {
                        rs=x.sieuno_executediversosv2(texto,si_variables.getconexiongral());
                        while (rs.next())
                        {
                            if (rs.getInt(1) > 0)
                                    {
                                        JOptionPane.showMessageDialog(null,"Documento "+rs.getInt(1)+" Correcto, Gracias", "Sistema Integral(Alta Prenomina) : Confirmacion",1);
                                       // this.jtf_idfolio.setText(rs.getString(1));
                                        //this.Limpiar_compra();
                                    }
                                else
                                    {
                                        JOptionPane.showMessageDialog(null," Error Verifique sus Cantidades", "Sistema Integral(Alta Compra) : Error",1);
                                    }
                        }
                    } catch(Exception e) {
                        System.out.println(e.getMessage());
                        JOptionPane.showMessageDialog(null," Recepcion Incorrecta ", "Sistema Integral(Alta Compra) : Error",1);
                    }
                }//fin del if qu confirmo guardar diferencia
    }

private void carga_datos_empleado_cat(int opcion,String textobusca)
   {
       //invoco al metodo que trae el recordset de datos
       //voy por el detalle del documento
       while(jtable_modelo_empleado.getRowCount()>0)jtable_modelo_empleado.removeRow(0);
       Object[] fnewRow = new Object[8];
       try
       {
            rs = x.sieuno_executediversosv2("select * from x1_supervision_empleadosv2("+opcion+",'"+textobusca+"') as (id integer,nombre text,dom_calle character varying(80),dom_colnia character varying(80),dom_pobla character varying(50),dom_codpost character varying(10),dom_codidenti character varying(20),id_tienventas integer,id_depart smallint,id_puesto smallint,id_status smallint,id_jefeinme smallint,id_tipojor smallint,fecha_nac text,fecha_alta text,fecha_baja text,rfc character varying(18),curp character varying(20),imss character varying(20),foto character varying(80),id_causabaja smallint,id_clasif smallint,id_sexo smallint,id_tiposan smallint,id_stadocivil smallint,id_sieuno integer,id_tipocon smallint,descri_depa character varying(80),descri_puesto text,descri_status character varying(25),descri_jorna character varying(25),descri_baja character varying(25),descri_clasif character varying(25),descri_sangre character varying(25),descri_stadocivil character varying(25),descri_contrato character varying(25),telefono character varying(50),email character varying(50));",si_variables.getconexiongral());
            while (rs.next())
                {
                        fnewRow[0]=rs.getString("id_status")+":"+rs.getString("descri_status");
                        fnewRow[1]=rs.getString("id_depart")+":"+rs.getString("descri_depa");
                        fnewRow[2]=rs.getString("id_puesto")+":"+rs.getString("descri_puesto");
                        fnewRow[3]=rs.getString("id")+":"+rs.getString("nombre");
                        fnewRow[4]=rs.getString("dom_calle");
                        fnewRow[5]=rs.getString("telefono");
                        fnewRow[6]=rs.getString("email");
                        fnewRow[7]=rs.getString("fecha_alta");
                        jtable_modelo_empleado.addRow(fnewRow);
                }
       }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }
       this.registrosobtenidos();
   }
void registrosobtenidos()
 {
     //limpiar la tabla
    this.jlbl_cantidadregistros.setText(String.valueOf(this.jtable_modelo_empleado.getRowCount()));
    this.jlbl_textobuscado.setText(this.jtf_busqueda.getText().toUpperCase().trim());
 }
private void dioclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         System.out.println("dio doble  click");
           int fila = jt_detalleprenomina.getSelectedRow();
           String idcadena[]=this.jt_detalleprenomina.getValueAt(fila, 1).toString().split(":");
           int columna = jt_detalleprenomina.getSelectedColumn();
           if (columna<2)
                {
                   this.carga_datos_asistencia(11, idcadena[0],this.fechaamericana(this.jdc_insidenciasini.getDate()),this.fechaamericana(this.jdc_insidenciasfin.getDate()));
                   this.jtf_empleadodes.setText(this.jt_detalleprenomina.getValueAt(fila, 1).toString());
                }
    }

private int findcolumna_idperoded (String titulo)  {
  int columnas = jtable_modelo_detalleprenomina.getColumnCount(),columencontrado=0;
  String columtitulo[]=null;
      for(int j = 0 ;j < columnas ; j++)
                {
                    columtitulo= jtable_modelo_detalleprenomina.getColumnName(j).replace("<html><b>","").split(":");
                    if(columtitulo[0].equals(titulo))
                        {
                            columencontrado=j;
                        }
                }
    return columencontrado;
}

private void carga_datos_empleado_detalle_movreload(int opcion,String textobusca,String depa)
   {
       //invoco al metodo que trae el recordset de datos
       //voy por el detalle del documento

       int colu=0;
       try
           {
            rs = x.sieuno_executediversosv2("select * from x1_supervision_empleados_prenomina_doctos_catalogo("+opcion+",'"+textobusca+"','','') as (id integer,iddocto integer,idperoded smallint,cantidad numeric,ididempleado integer,nombre character varying(50),apat character varying(50));",si_variables.getconexiongral());
            while (rs.next())
                {
                        colu=this.findcolumna_idperoded(rs.getString("idperoded"));
                        this.crea_hojempleadosaprenominareload(rs.getString("ididempleado"),depa,rs.getString("nombre")+" "+rs.getString("apat"),"","",rs.getString("cantidad"),colu,"","");
                }
           }
        catch(Exception e)
            {
            System.out.println(e.getMessage());
            }

    }
private void crea_hojempleadosaprenominareload(String idempleado,String departamento,String nombre,String horaentrada,String horasalida,String cantidad,int columna,String observacion,String fechaingreso)
    {
        int numerofilas=this.jtable_modelo_detalleprenomina.getRowCount();
        String empleadoactual[]=null,iddepto[]=null;
        int numerocolumnas=jt_detalleprenomina.getColumnModel().getColumnCount(),ii=00,encontrado=0;
        Object[] fnewRow = new Object[numerocolumnas];

       //invoco al metodo que trae el recordset de datos
        for( ii=0;ii<numerofilas;ii++)
                {
                    empleadoactual=jtable_modelo_detalleprenomina.getValueAt(ii, 1).toString().split(":");
                     if (empleadoactual[0].equals(idempleado))
                        {
                            encontrado=1;
                            jtable_modelo_detalleprenomina.setValueAt(cantidad,ii ,columna);
                        }
                }
       if(encontrado==0)
            {
                 fnewRow[0]=departamento;
                 fnewRow[1]=idempleado+":"+nombre+"("+fechaingreso+")";
                 for(ii=2;ii<numerocolumnas;ii++)
                            {
                                        if(ii==columna)
                                        fnewRow[ii]=cantidad;
                                        else
                                        fnewRow[ii]="0";
                             }
                 fnewRow[numerocolumnas-1]=observacion;
          jtable_modelo_detalleprenomina.addRow(fnewRow);
          iddepto=departamento.split(":");

            }
    }


private String DiaSemana(String fe) {
         String dia = "";
       java.util.Date fecha=null;
         try
            {
             fecha = formateador.parse(fe);

           }
        catch (ParseException e)
            {
            //Error, la cadena de texto no se puede convertir en fecha.
            }
        Calendar cal= Calendar.getInstance();
        cal.setTime(fecha);
        //ojo para establecer o recetear cada parte de la fecha por separado
        //cal.set(Calendar.YEAR, fecha.getYear());
        //cal.set(Calendar.MONTH, fecha.getMonth());
        //cal.set(Calendar.DAY_OF_MONTH, fecha.getDay());
        int diaInt = cal.get(Calendar.DAY_OF_WEEK);
        switch (diaInt) {
            case 1:
                dia = "Domingo";
                break;
            case 2:
                dia = "Lunes";
                break;
            case 3:
                dia = "Martes";
                break;
            case 4:
                dia = "Miercoles";
                break;
            case 5:
                dia = "Jueves";
                break;
            case 6:
                dia = "Viernes";
                break;
            case 7:
                dia = "Sabado";
                break;

        }
        return dia;
    }


private String  fechaamericana(String fecha) {

         //resibe cadena de fecha en formato americano dd-MM-yyyy
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaamericano = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateador.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaamericano.format(fechaestaeuropa);
       return cadenafecha;

    }

    private String  fechaeuropea(Date fecha) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";

       cadenafecha= formateadorestaeuropa.format(fecha);
       return cadenafecha;

    }

    private String fechaamericana(Date fe) {
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("yyyy-MM-dd");
       String cadenafecha="";
       cadenafecha= formateadorestaeuropa.format(fe);
       return cadenafecha;

    }
    private String  fechaeuropea(String fecha) {

         //resibe cadena de fecha en formato americano yyyy-MM-dd
        java.util.Date fechaestaeuropa=null;
       SimpleDateFormat formateadorestaeuropa = new SimpleDateFormat("dd-MM-yyyy");
       String cadenafecha="";
        try
         {
          fechaestaeuropa = formateadoresta.parse(fecha);
         }
        catch (ParseException e)
          {
             //Error, la cadena de texto no se puede convertir en fecha.
          }
       cadenafecha= formateadorestaeuropa.format(fechaestaeuropa);
       return cadenafecha;

    }
private void diodblclick(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
         int fila = jt_catempleados.getSelectedRow();
         String idcadena[]=this.jt_catempleados.getValueAt(fila, 3).toString().split(":");
         this.jtf_bidempleado.setText(idcadena[0]);
         this.jtf_bempleadonombre.setText(idcadena[1]);
     }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup1 = new javax.swing.ButtonGroup();
        jPanel5 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jtf_tituloprenomina = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jdc_fechadocto = new com.toedter.calendar.JDateChooser();
        jdc_rangofinal = new com.toedter.calendar.JDateChooser();
        jLabel4 = new javax.swing.JLabel();
        jdc_fechainicio = new com.toedter.calendar.JDateChooser();
        jLabel3 = new javax.swing.JLabel();
        jLabel5 = new javax.swing.JLabel();
        jtf_observaindica = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jdc_insidenciasini = new com.toedter.calendar.JDateChooser();
        jLabel7 = new javax.swing.JLabel();
        jdc_insidenciasfin = new com.toedter.calendar.JDateChooser();
        jcmbox_depart = new javax.swing.JComboBox();
        jLabel8 = new javax.swing.JLabel();
        jLabel9 = new javax.swing.JLabel();
        jcmbox_idperiodo = new javax.swing.JComboBox();
        jtf_peridodias = new javax.swing.JTextField();
        jLabel14 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jPanel3 = new javax.swing.JPanel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jt_detalleprenomina = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                if (mColIndex>1)
                return true;
                else
                return false;
            }
        }
        ;
        jlbl_textobuscado = new javax.swing.JLabel();
        jPanel11 = new javax.swing.JPanel();
        jScrollPane10 = new javax.swing.JScrollPane();
        jt_historialasistencia = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jScrollPane11 = new javax.swing.JScrollPane();
        jt_resumenhistorial = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jchbx_eliminarfila = new javax.swing.JCheckBox();
        jchbx_verempleado = new javax.swing.JCheckBox();
        jtf_empleadodes = new javax.swing.JTextField();
        jbtn_guardasolicitud = new javax.swing.JButton();
        jScrollPane12 = new javax.swing.JScrollPane();
        jt_resumenhistorialpuntual = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel1 = new javax.swing.JPanel();
        jScrollPane2 = new javax.swing.JScrollPane();
        jt_detalleprenomina1 = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jScrollPane6 = new javax.swing.JScrollPane();
        jlst_clientesdistribucion = new javax.swing.JList();
        jScrollPane3 = new javax.swing.JScrollPane();
        jt_detalleprenomina2 = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jPanel4 = new javax.swing.JPanel();
        jPanel6 = new javax.swing.JPanel();
        jtf_busqueda = new javax.swing.JTextField();
        jbtn_buscar = new javax.swing.JButton();
        jrb_departamento = new javax.swing.JRadioButton();
        jrb_bdescrip = new javax.swing.JRadioButton();
        jrb_bclave = new javax.swing.JRadioButton();
        jLabel11 = new javax.swing.JLabel();
        jPanel7 = new javax.swing.JPanel();
        jScrollPane4 = new javax.swing.JScrollPane();
        jt_catempleados = new javax.swing.JTable()
        {
            public boolean isCellEditable(int rowIndex, int mColIndex) {
                return false;
            }
        }
        ;
        jLabel10 = new javax.swing.JLabel();
        jlbl_textobuscado1 = new javax.swing.JLabel();
        jLabel12 = new javax.swing.JLabel();
        jlbl_cantidadregistros = new javax.swing.JLabel();
        jLabel13 = new javax.swing.JLabel();
        jtf_bidempleado = new javax.swing.JTextField();
        jtf_bempleadonombre = new javax.swing.JTextField();
        jbtn_agregar = new javax.swing.JButton();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jmni_salir = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jmni_escape = new javax.swing.JMenuItem();
        jmni_limpiartabla = new javax.swing.JMenuItem();
        jmni_imprimirhisasi = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.DISPOSE_ON_CLOSE);
        org.jdesktop.application.ResourceMap resourceMap = org.jdesktop.application.Application.getInstance(si_rhnominafacil.Si_rhnominafacilApp.class).getContext().getResourceMap(rh_empleados_prenomina_agregar.class);
        setTitle(resourceMap.getString("Form.title")); // NOI18N
        setName("Form"); // NOI18N

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel5.border.title"))); // NOI18N
        jPanel5.setName("jPanel5"); // NOI18N

        jLabel1.setText(resourceMap.getString("jLabel1.text")); // NOI18N
        jLabel1.setName("jLabel1"); // NOI18N

        jtf_tituloprenomina.setText(resourceMap.getString("jtf_tituloprenomina.text")); // NOI18N
        jtf_tituloprenomina.setToolTipText(resourceMap.getString("jtf_tituloprenomina.toolTipText")); // NOI18N
        jtf_tituloprenomina.setName("jtf_tituloprenomina"); // NOI18N

        jLabel2.setText(resourceMap.getString("jLabel2.text")); // NOI18N
        jLabel2.setName("jLabel2"); // NOI18N

        jdc_fechadocto.setDateFormatString(resourceMap.getString("jdc_fechadocto.dateFormatString")); // NOI18N
        jdc_fechadocto.setName("jdc_fechadocto"); // NOI18N

        jdc_rangofinal.setDateFormatString(resourceMap.getString("jdc_rangofinal.dateFormatString")); // NOI18N
        jdc_rangofinal.setEnabled(false);
        jdc_rangofinal.setName("jdc_rangofinal"); // NOI18N

        jLabel4.setText(resourceMap.getString("jLabel4.text")); // NOI18N
        jLabel4.setName("jLabel4"); // NOI18N

        jdc_fechainicio.setDateFormatString(resourceMap.getString("jdc_fechainicio.dateFormatString")); // NOI18N
        jdc_fechainicio.setEnabled(false);
        jdc_fechainicio.setName("jdc_fechainicio"); // NOI18N

        jLabel3.setFont(resourceMap.getFont("jLabel3.font")); // NOI18N
        jLabel3.setText(resourceMap.getString("jLabel3.text")); // NOI18N
        jLabel3.setName("jLabel3"); // NOI18N

        jLabel5.setText(resourceMap.getString("jLabel5.text")); // NOI18N
        jLabel5.setName("jLabel5"); // NOI18N

        jtf_observaindica.setText(resourceMap.getString("jtf_observaindica.text")); // NOI18N
        jtf_observaindica.setToolTipText(resourceMap.getString("jtf_observaindica.toolTipText")); // NOI18N
        jtf_observaindica.setName("jtf_observaindica"); // NOI18N

        jLabel6.setFont(resourceMap.getFont("jLabel6.font")); // NOI18N
        jLabel6.setText(resourceMap.getString("jLabel6.text")); // NOI18N
        jLabel6.setName("jLabel6"); // NOI18N

        jdc_insidenciasini.setDateFormatString(resourceMap.getString("jdc_insidenciasini.dateFormatString")); // NOI18N
        jdc_insidenciasini.setEnabled(false);
        jdc_insidenciasini.setName("jdc_insidenciasini"); // NOI18N

        jLabel7.setText(resourceMap.getString("jLabel7.text")); // NOI18N
        jLabel7.setName("jLabel7"); // NOI18N

        jdc_insidenciasfin.setDateFormatString(resourceMap.getString("jdc_insidenciasfin.dateFormatString")); // NOI18N
        jdc_insidenciasfin.setEnabled(false);
        jdc_insidenciasfin.setName("jdc_insidenciasfin"); // NOI18N

        jcmbox_depart.setToolTipText(resourceMap.getString("jcmbox_depart.toolTipText")); // NOI18N
        jcmbox_depart.setName("jcmbox_depart"); // NOI18N
        jcmbox_depart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbox_departActionPerformed(evt);
            }
        });

        jLabel8.setText(resourceMap.getString("jLabel8.text")); // NOI18N
        jLabel8.setName("jLabel8"); // NOI18N

        jLabel9.setText(resourceMap.getString("jLabel9.text")); // NOI18N
        jLabel9.setName("jLabel9"); // NOI18N

        jcmbox_idperiodo.setToolTipText(resourceMap.getString("jcmbox_idperiodo.toolTipText")); // NOI18N
        jcmbox_idperiodo.setName("jcmbox_idperiodo"); // NOI18N
        jcmbox_idperiodo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jcmbox_idperiodoActionPerformed(evt);
            }
        });

        jtf_peridodias.setEditable(false);
        jtf_peridodias.setText(resourceMap.getString("jtf_peridodias.text")); // NOI18N
        jtf_peridodias.setName("jtf_peridodias"); // NOI18N

        jLabel14.setText(resourceMap.getString("jLabel14.text")); // NOI18N
        jLabel14.setName("jLabel14"); // NOI18N

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addComponent(jLabel5)
                        .addGap(18, 18, 18)
                        .addComponent(jtf_observaindica, javax.swing.GroupLayout.PREFERRED_SIZE, 605, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel2)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jdc_fechadocto, javax.swing.GroupLayout.PREFERRED_SIZE, 129, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel1)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jtf_tituloprenomina, javax.swing.GroupLayout.PREFERRED_SIZE, 309, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jLabel9)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jcmbox_idperiodo, 0, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel3)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jdc_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel4)
                                .addGap(12, 12, 12)
                                .addComponent(jdc_rangofinal, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addGap(28, 28, 28)
                                .addComponent(jLabel6)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jdc_insidenciasini, javax.swing.GroupLayout.PREFERRED_SIZE, 114, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                                .addComponent(jLabel7)
                                .addGap(12, 12, 12)
                                .addComponent(jdc_insidenciasfin, javax.swing.GroupLayout.PREFERRED_SIZE, 113, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel8)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                                .addComponent(jcmbox_depart, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addGroup(jPanel5Layout.createSequentialGroup()
                                .addComponent(jLabel14)
                                .addGap(18, 18, 18)
                                .addComponent(jtf_peridodias, javax.swing.GroupLayout.PREFERRED_SIZE, 52, javax.swing.GroupLayout.PREFERRED_SIZE)))))
                .addContainerGap(21, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel8)
                            .addComponent(jcmbox_depart, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                            .addComponent(jLabel14)
                            .addComponent(jtf_peridodias, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                    .addGroup(jPanel5Layout.createSequentialGroup()
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                                .addComponent(jLabel1)
                                .addComponent(jtf_tituloprenomina, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                                .addComponent(jLabel9)
                                .addComponent(jcmbox_idperiodo, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 14, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jdc_fechadocto, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addComponent(jdc_insidenciasfin, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel6)
                            .addComponent(jdc_insidenciasini, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel7)
                            .addComponent(jdc_rangofinal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel3)
                            .addComponent(jdc_fechainicio, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                            .addComponent(jLabel4))))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_observaindica, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabel5)))
        );

        jTabbedPane1.setName("jTabbedPane1"); // NOI18N

        jPanel3.setBorder(javax.swing.BorderFactory.createEmptyBorder(1, 1, 1, 1));
        jPanel3.setName("jPanel3"); // NOI18N

        jScrollPane1.setName("jScrollPane1"); // NOI18N

        jt_detalleprenomina.setModel(this.jtable_modelo_detalleprenomina);
        jt_detalleprenomina.setName("jt_detalleprenomina"); // NOI18N
        jt_detalleprenomina.setRowHeight(22);
        jt_detalleprenomina.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_detalleprenominaMouseClicked(evt);
                if(evt.getClickCount() >= 1)
                {
                    dioclick(evt);
                }
            }
        });
        jt_detalleprenomina.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_detalleprenominaMouseClicked(evt);
            }
        });
        jt_detalleprenomina.addPropertyChangeListener(new java.beans.PropertyChangeListener() {
            public void propertyChange(java.beans.PropertyChangeEvent evt) {
                jt_detalleprenominaPropertyChange(evt);
            }
        });
        jScrollPane1.setViewportView(jt_detalleprenomina);

        jlbl_textobuscado.setFont(resourceMap.getFont("jlbl_textobuscado.font")); // NOI18N
        jlbl_textobuscado.setName("jlbl_textobuscado"); // NOI18N

        jPanel11.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel11.border.title"))); // NOI18N
        jPanel11.setName("jPanel11"); // NOI18N

        jScrollPane10.setName("jScrollPane10"); // NOI18N

        jt_historialasistencia.setModel(this.jtable_modelo_asistenciaxdia);
        jt_historialasistencia.setName("jt_historialasistencia"); // NOI18N
        jt_historialasistencia.setRowHeight(25);
        jScrollPane10.setViewportView(jt_historialasistencia);

        jScrollPane11.setName("jScrollPane11"); // NOI18N

        jt_resumenhistorial.setModel(this.jtable_modelo_historialresumen);
        jt_resumenhistorial.setName("jt_resumenhistorial"); // NOI18N
        jt_resumenhistorial.setRowHeight(25);
        jScrollPane11.setViewportView(jt_resumenhistorial);

        jchbx_eliminarfila.setText(resourceMap.getString("jchbx_eliminarfila.text")); // NOI18N
        jchbx_eliminarfila.setName("jchbx_eliminarfila"); // NOI18N
        jchbx_eliminarfila.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jchbx_eliminarfilaActionPerformed(evt);
            }
        });

        jchbx_verempleado.setText(resourceMap.getString("jchbx_verempleado.text")); // NOI18N
        jchbx_verempleado.setName("jchbx_verempleado"); // NOI18N
        jchbx_verempleado.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jchbx_verempleadoActionPerformed(evt);
            }
        });

        jtf_empleadodes.setEditable(false);
        jtf_empleadodes.setFont(resourceMap.getFont("jtf_empleadodes.font")); // NOI18N
        jtf_empleadodes.setText(resourceMap.getString("jtf_empleadodes.text")); // NOI18N
        jtf_empleadodes.setName("jtf_empleadodes"); // NOI18N

        jbtn_guardasolicitud.setIcon(resourceMap.getIcon("jbtn_guardasolicitud.icon")); // NOI18N
        jbtn_guardasolicitud.setText(resourceMap.getString("jbtn_guardasolicitud.text")); // NOI18N
        jbtn_guardasolicitud.setToolTipText(resourceMap.getString("jbtn_guardasolicitud.toolTipText")); // NOI18N
        jbtn_guardasolicitud.setName("jbtn_guardasolicitud"); // NOI18N
        jbtn_guardasolicitud.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_guardasolicitudActionPerformed(evt);
            }
        });

        jScrollPane12.setName("jScrollPane12"); // NOI18N

        jt_resumenhistorialpuntual.setModel(this.jtable_modelo_historialpuntualidad);
        jt_resumenhistorialpuntual.setName("jt_resumenhistorialpuntual"); // NOI18N
        jt_resumenhistorialpuntual.setRowHeight(25);
        jScrollPane12.setViewportView(jt_resumenhistorialpuntual);

        javax.swing.GroupLayout jPanel11Layout = new javax.swing.GroupLayout(jPanel11);
        jPanel11.setLayout(jPanel11Layout);
        jPanel11Layout.setHorizontalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createSequentialGroup()
                        .addComponent(jchbx_eliminarfila)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jchbx_verempleado)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jtf_empleadodes, javax.swing.GroupLayout.PREFERRED_SIZE, 389, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jbtn_guardasolicitud)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jScrollPane11, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE))
                    .addComponent(jScrollPane12, javax.swing.GroupLayout.Alignment.TRAILING, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE)))
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(jPanel11Layout.createSequentialGroup()
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 665, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addContainerGap(324, Short.MAX_VALUE)))
        );
        jPanel11Layout.setVerticalGroup(
            jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel11Layout.createSequentialGroup()
                .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                        .addComponent(jchbx_eliminarfila)
                        .addComponent(jchbx_verempleado)
                        .addComponent(jtf_empleadodes, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addComponent(jbtn_guardasolicitud))
                    .addComponent(jScrollPane11, javax.swing.GroupLayout.DEFAULT_SIZE, 105, Short.MAX_VALUE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane12, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE))
            .addGroup(jPanel11Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel11Layout.createSequentialGroup()
                    .addContainerGap(29, Short.MAX_VALUE)
                    .addComponent(jScrollPane10, javax.swing.GroupLayout.PREFERRED_SIZE, 162, javax.swing.GroupLayout.PREFERRED_SIZE)))
        );

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel3Layout.createSequentialGroup()
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jScrollPane1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 1005, Short.MAX_VALUE)
                    .addGroup(javax.swing.GroupLayout.Alignment.LEADING, jPanel3Layout.createSequentialGroup()
                        .addGap(81, 81, 81)
                        .addComponent(jlbl_textobuscado, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addComponent(jlbl_textobuscado)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 238, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel11, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel3.TabConstraints.tabTitle"), jPanel3); // NOI18N

        jPanel1.setName("jPanel1"); // NOI18N

        jScrollPane2.setName("jScrollPane2"); // NOI18N

        jt_detalleprenomina1.setModel(this.jtable_modelo_detallepreinterno);
        jt_detalleprenomina1.setName("jt_detalleprenomina1"); // NOI18N
        jt_detalleprenomina1.setRowHeight(22);
        jScrollPane2.setViewportView(jt_detalleprenomina1);

        jScrollPane6.setName("jScrollPane6"); // NOI18N

        jlst_clientesdistribucion.setModel(this.modelo);
        jlst_clientesdistribucion.setSelectionMode(javax.swing.ListSelectionModel.SINGLE_SELECTION);
        jlst_clientesdistribucion.setName("jlst_clientesdistribucion"); // NOI18N
        jScrollPane6.setViewportView(jlst_clientesdistribucion);

        jScrollPane3.setName("jScrollPane3"); // NOI18N

        jt_detalleprenomina2.setModel(this.jtable_modelo_detallepreinternoobs);
        jt_detalleprenomina2.setName("jt_detalleprenomina2"); // NOI18N
        jScrollPane3.setViewportView(jt_detalleprenomina2);

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jScrollPane6, javax.swing.GroupLayout.PREFERRED_SIZE, 170, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jScrollPane2, javax.swing.GroupLayout.PREFERRED_SIZE, 426, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jScrollPane3, javax.swing.GroupLayout.PREFERRED_SIZE, 373, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap(30, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jScrollPane3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addComponent(jScrollPane2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 451, Short.MAX_VALUE)
                    .addComponent(jScrollPane6, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.PREFERRED_SIZE, 317, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel1.TabConstraints.tabTitle"), jPanel1); // NOI18N

        jPanel4.setName("jPanel4"); // NOI18N

        jPanel6.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel6.border.title"))); // NOI18N
        jPanel6.setName("jPanel6"); // NOI18N

        jtf_busqueda.setToolTipText(resourceMap.getString("jtf_busqueda.toolTipText")); // NOI18N
        jtf_busqueda.setName("jtf_busqueda"); // NOI18N
        jtf_busqueda.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jtf_busquedaActionPerformed(evt);
            }
        });

        jbtn_buscar.setIcon(resourceMap.getIcon("jbtn_buscar.icon")); // NOI18N
        jbtn_buscar.setText(resourceMap.getString("jbtn_buscar.text")); // NOI18N
        jbtn_buscar.setName("jbtn_buscar"); // NOI18N
        jbtn_buscar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_buscarActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_departamento);
        jrb_departamento.setText(resourceMap.getString("jrb_departamento.text")); // NOI18N
        jrb_departamento.setToolTipText(resourceMap.getString("jrb_departamento.toolTipText")); // NOI18N
        jrb_departamento.setActionCommand(resourceMap.getString("jrb_departamento.actionCommand")); // NOI18N
        jrb_departamento.setName("jrb_departamento"); // NOI18N
        jrb_departamento.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_departamentoActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bdescrip);
        jrb_bdescrip.setText(resourceMap.getString("jrb_bdescrip.text")); // NOI18N
        jrb_bdescrip.setToolTipText(resourceMap.getString("jrb_bdescrip.toolTipText")); // NOI18N
        jrb_bdescrip.setActionCommand(resourceMap.getString("jrb_bdescrip.actionCommand")); // NOI18N
        jrb_bdescrip.setName("jrb_bdescrip"); // NOI18N
        jrb_bdescrip.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bdescripActionPerformed(evt);
            }
        });

        buttonGroup1.add(jrb_bclave);
        jrb_bclave.setText(resourceMap.getString("jrb_bclave.text")); // NOI18N
        jrb_bclave.setToolTipText(resourceMap.getString("jrb_bclave.toolTipText")); // NOI18N
        jrb_bclave.setActionCommand(resourceMap.getString("jrb_bclave.actionCommand")); // NOI18N
        jrb_bclave.setName("jrb_bclave"); // NOI18N
        jrb_bclave.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jrb_bclaveActionPerformed(evt);
            }
        });

        jLabel11.setText(resourceMap.getString("jLabel11.text")); // NOI18N
        jLabel11.setName("jLabel11"); // NOI18N

        javax.swing.GroupLayout jPanel6Layout = new javax.swing.GroupLayout(jPanel6);
        jPanel6.setLayout(jPanel6Layout);
        jPanel6Layout.setHorizontalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGap(236, 236, 236)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jrb_bclave)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addGap(34, 34, 34)
                        .addComponent(jrb_bdescrip)
                        .addGap(30, 30, 30)
                        .addComponent(jrb_departamento))
                    .addGroup(jPanel6Layout.createSequentialGroup()
                        .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, 173, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(31, 31, 31)
                        .addComponent(jbtn_buscar)))
                .addContainerGap(558, Short.MAX_VALUE))
        );
        jPanel6Layout.setVerticalGroup(
            jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel6Layout.createSequentialGroup()
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jtf_busqueda, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_buscar)
                    .addComponent(jLabel11))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGroup(jPanel6Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jrb_departamento)
                    .addComponent(jrb_bclave)
                    .addComponent(jrb_bdescrip))
                .addContainerGap())
        );

        jPanel7.setBorder(javax.swing.BorderFactory.createTitledBorder(resourceMap.getString("jPanel7.border.title"))); // NOI18N
        jPanel7.setName("jPanel7"); // NOI18N

        jScrollPane4.setName("jScrollPane4"); // NOI18N

        jt_catempleados.setModel(this.jtable_modelo_empleado);
        jt_catempleados.setName("jt_catempleados"); // NOI18N
        jt_catempleados.setRowHeight(22);
        jt_catempleados.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jt_catempleadosMouseClicked(evt);
                if(evt.getClickCount() >= 1)
                {
                    diodblclick(evt);
                    //System.out.println(" double click" );

                }
            }
        });
        jScrollPane4.setViewportView(jt_catempleados);

        jLabel10.setText(resourceMap.getString("jLabel10.text")); // NOI18N
        jLabel10.setName("jLabel10"); // NOI18N

        jlbl_textobuscado1.setFont(resourceMap.getFont("jlbl_textobuscado1.font")); // NOI18N
        jlbl_textobuscado1.setName("jlbl_textobuscado1"); // NOI18N

        jLabel12.setFont(resourceMap.getFont("jLabel12.font")); // NOI18N
        jLabel12.setText(resourceMap.getString("jLabel12.text")); // NOI18N
        jLabel12.setName("jLabel12"); // NOI18N

        jlbl_cantidadregistros.setFont(resourceMap.getFont("jlbl_cantidadregistros.font")); // NOI18N
        jlbl_cantidadregistros.setText(resourceMap.getString("jlbl_cantidadregistros.text")); // NOI18N
        jlbl_cantidadregistros.setName("jlbl_cantidadregistros"); // NOI18N

        jLabel13.setFont(resourceMap.getFont("jLabel13.font")); // NOI18N
        jLabel13.setText(resourceMap.getString("jLabel13.text")); // NOI18N
        jLabel13.setName("jLabel13"); // NOI18N

        jtf_bidempleado.setEditable(false);
        jtf_bidempleado.setFont(resourceMap.getFont("jtf_bidempleado.font")); // NOI18N
        jtf_bidempleado.setText(resourceMap.getString("jtf_bidempleado.text")); // NOI18N
        jtf_bidempleado.setName("jtf_bidempleado"); // NOI18N

        jtf_bempleadonombre.setEditable(false);
        jtf_bempleadonombre.setFont(resourceMap.getFont("jtf_bempleadonombre.font")); // NOI18N
        jtf_bempleadonombre.setName("jtf_bempleadonombre"); // NOI18N

        jbtn_agregar.setIcon(resourceMap.getIcon("jbtn_agregar.icon")); // NOI18N
        jbtn_agregar.setText(resourceMap.getString("jbtn_agregar.text")); // NOI18N
        jbtn_agregar.setName("jbtn_agregar"); // NOI18N
        jbtn_agregar.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jbtn_agregarActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addComponent(jLabel10)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jlbl_textobuscado1, javax.swing.GroupLayout.PREFERRED_SIZE, 88, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel12)
                .addGap(18, 18, 18)
                .addComponent(jlbl_cantidadregistros, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabel13)
                .addGap(156, 156, 156)
                .addComponent(jtf_bidempleado, javax.swing.GroupLayout.PREFERRED_SIZE, 86, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jtf_bempleadonombre, javax.swing.GroupLayout.PREFERRED_SIZE, 236, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addComponent(jbtn_agregar)
                .addGap(126, 126, 126))
            .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 1138, Short.MAX_VALUE)
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel13)
                    .addComponent(jlbl_cantidadregistros)
                    .addComponent(jLabel12)
                    .addComponent(jLabel10)
                    .addComponent(jlbl_textobuscado1)
                    .addComponent(jtf_bidempleado, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jtf_bempleadonombre, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jbtn_agregar))
                .addGap(9, 9, 9)
                .addComponent(jScrollPane4, javax.swing.GroupLayout.DEFAULT_SIZE, 312, Short.MAX_VALUE))
        );

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jPanel7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanel6, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(20, 20, 20))
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addComponent(jPanel6, javax.swing.GroupLayout.PREFERRED_SIZE, 80, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanel7, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jTabbedPane1.addTab(resourceMap.getString("jPanel4.TabConstraints.tabTitle"), jPanel4); // NOI18N

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText(resourceMap.getString("jMenu1.text")); // NOI18N
        jMenu1.setName("jMenu1"); // NOI18N

        jmni_salir.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_S, java.awt.event.InputEvent.ALT_MASK));
        jmni_salir.setIcon(resourceMap.getIcon("jmni_salir.icon")); // NOI18N
        jmni_salir.setText(resourceMap.getString("jmni_salir.text")); // NOI18N
        jmni_salir.setName("jmni_salir"); // NOI18N
        jmni_salir.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_salirActionPerformed(evt);
            }
        });
        jMenu1.add(jmni_salir);

        jMenuBar1.add(jMenu1);

        jMenu2.setText(resourceMap.getString("jMenu2.text")); // NOI18N
        jMenu2.setName("jMenu2"); // NOI18N

        jmni_escape.setAccelerator(javax.swing.KeyStroke.getKeyStroke(java.awt.event.KeyEvent.VK_ESCAPE, 0));
        jmni_escape.setText(resourceMap.getString("jmni_escape.text")); // NOI18N
        jmni_escape.setName("jmni_escape"); // NOI18N
        jmni_escape.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_escapeActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_escape);

        jmni_limpiartabla.setText(resourceMap.getString("jmni_limpiartabla.text")); // NOI18N
        jmni_limpiartabla.setName("jmni_limpiartabla"); // NOI18N
        jmni_limpiartabla.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_limpiartablaActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_limpiartabla);

        jmni_imprimirhisasi.setText(resourceMap.getString("jmni_imprimirhisasi.text")); // NOI18N
        jmni_imprimirhisasi.setName("jmni_imprimirhisasi"); // NOI18N
        jmni_imprimirhisasi.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jmni_imprimirhisasiActionPerformed(evt);
            }
        });
        jMenu2.add(jmni_imprimirhisasi);

        jMenuBar1.add(jMenu2);

        jMenu3.setText(resourceMap.getString("jMenu3.text")); // NOI18N
        jMenu3.setName("jMenu3"); // NOI18N
        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 1020, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel5, javax.swing.GroupLayout.PREFERRED_SIZE, 108, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 501, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jbtn_guardasolicitudActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_guardasolicitudActionPerformed
        // TODO add your handling code here:
        if(this.jtf_tituloprenomina.getText().toString().length()> 0)
            {
             this.crea_hojempleados_controlinternoupdate();
           
                        this.documento_guardar(1);
        }
}//GEN-LAST:event_jbtn_guardasolicitudActionPerformed

    private void jmni_salirActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_salirActionPerformed
        // TODO add your handling code here:
          if(JOptionPane.showConfirmDialog(null, "Desea Salir?")==0)
                {
                    this.dispose();
                }
    }//GEN-LAST:event_jmni_salirActionPerformed

    private void jmni_escapeActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_escapeActionPerformed
        // TODO add your handling code here:
        this.jmni_salirActionPerformed(evt);
    }//GEN-LAST:event_jmni_escapeActionPerformed

    private void jcmbox_departActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbox_departActionPerformed
        // TODO add your handling code here:
        if(controlcomboasi==1)
            {
            if(Integer.valueOf(this.jtf_peridodias.getText())>0)
                {
                if(JOptionPane.showConfirmDialog(null, "Estan Correcto?")==0)
                    {
                        String arreglo_depasi[]=this.jcmbox_depart.getSelectedItem().toString().split(":");
                        this.carga_datos_empleado(11, arreglo_depasi[0]);
                    }
                }
            else
                {
                    JOptionPane.showMessageDialog(null,"elija un Periodo", "Sistema Integral(Prenominas) : Error",1);
                }
            }
}//GEN-LAST:event_jcmbox_departActionPerformed

    private void jt_detalleprenominaPropertyChange(java.beans.PropertyChangeEvent evt) {//GEN-FIRST:event_jt_detalleprenominaPropertyChange
        // TODO add your handling code here:
       
    }//GEN-LAST:event_jt_detalleprenominaPropertyChange

    private void jt_detalleprenominaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jt_detalleprenominaMouseClicked
        // TODO add your handling code here:
    }//GEN-LAST:event_jt_detalleprenominaMouseClicked

    private void jcmbox_idperiodoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jcmbox_idperiodoActionPerformed
        // TODO add your handling code here:
        if(combobusqueda>0)
            {
                String idper[]=this.jcmbox_idperiodo.getSelectedItem().toString().split(":");
                this.carga_datos_periodos(5, idper[0]);
                this.jtf_observaindica.requestFocus();
            }

}//GEN-LAST:event_jcmbox_idperiodoActionPerformed

    private void jchbx_eliminarfilaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_eliminarfilaActionPerformed
        // TODO add your handling code here:
         int fila = jt_detalleprenomina.getSelectedRow(),filasci=this.jtable_modelo_detallepreinterno.getRowCount(),i=0,ici=0,filasciobs=this.jtable_modelo_detallepreinternoobs.getRowCount();

        String empleadoactual[]=null,idpod="",idempleado[]=null, columtitulo[]=null;


        if(JOptionPane.showConfirmDialog(null, "<html><h2>Desea Eliminar Empleado?<br>"+this.jtable_modelo_detalleprenomina.getValueAt(fila, 1).toString()+"</h2><html>")==0) {

empleadoactual=this.jtable_modelo_detalleprenomina.getValueAt(fila, 1).toString().split(":");
             for( ici=0;ici<filasci;ici++)
                                 {
                                 idpod=jtable_modelo_detallepreinterno.getValueAt(ici, 0).toString();
                                     if (empleadoactual[0].equals(idpod))
                                         {
                                             this.jtable_modelo_detallepreinterno.removeRow(ici);
                                             filasci=filasci-1;
                                             ici=ici-1;
                                        }
                                 }

                 for( ici=0;ici<filasciobs;ici++)
                                 {
                                 idpod=jtable_modelo_detallepreinternoobs.getValueAt(ici, 0).toString();
                                     if (empleadoactual[0].equals(idpod))
                                         {
                                             this.jtable_modelo_detallepreinternoobs.removeRow(ici);
                                             filasciobs=filasciobs-1;
                                             ici=ici-1;
                                        }
                                 }
            jtable_modelo_detalleprenomina.removeRow(fila);

        }
}//GEN-LAST:event_jchbx_eliminarfilaActionPerformed

    private void jchbx_verempleadoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jchbx_verempleadoActionPerformed
        // TODO add your handling code here:
        int fila = jt_detalleprenomina.getSelectedRow();
        String codigo[]=this.jtable_modelo_detalleprenomina.getValueAt(fila, 1).toString().split(":");
                                     rh_empleados_edita fsrhe=new rh_empleados_edita(Integer.valueOf(codigo[0]),1);
                                     fsrhe.pack();
                                     fsrhe.setVisible(true);
}//GEN-LAST:event_jchbx_verempleadoActionPerformed

    private void jmni_limpiartablaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_limpiartablaActionPerformed
        // TODO add your handling code here:
        if(JOptionPane.showConfirmDialog(null, "Desea Limpiar Documento?")==0)
        {
            while(jtable_modelo_detalleprenomina.getRowCount()>0)jtable_modelo_detalleprenomina.removeRow(0);
            while(jtable_modelo_asistenciaxdia.getRowCount()>0)jtable_modelo_asistenciaxdia.removeRow(0);
            while(jtable_modelo_detallepreinterno.getRowCount()>0)jtable_modelo_detallepreinterno.removeRow(0);
            while(jtable_modelo_detallepreinternoobs.getRowCount()>0)jtable_modelo_detallepreinternoobs.removeRow(0);
        }
    }//GEN-LAST:event_jmni_limpiartablaActionPerformed

    private void jtf_busquedaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jtf_busquedaActionPerformed
        // TODO add your handling code here:
        this.jbtn_buscarActionPerformed(evt);
}//GEN-LAST:event_jtf_busquedaActionPerformed

    private void jbtn_buscarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_buscarActionPerformed
        // TODO add your handling code here:
        // this.jtf_busqueda.getText();
        if(JOptionPane.showConfirmDialog(null, "Estan Correctos sus Datos?")==0) {
            this.carga_datos_empleado_cat(opcioncatalogo, this.jtf_busqueda.getText().trim().toUpperCase());
        } else {
            this.jtf_busqueda.requestFocus();
        }

    }//GEN-LAST:event_jbtn_buscarActionPerformed

    private void jrb_departamentoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_departamentoActionPerformed
        // TODO add your handling code here:
        opcioncatalogo=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_departamentoActionPerformed

    private void jrb_bdescripActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bdescripActionPerformed
        // TODO add your handling code here:
        opcioncatalogo=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bdescripActionPerformed

    private void jrb_bclaveActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jrb_bclaveActionPerformed
        // TODO add your handling code here:
        opcioncatalogo=Integer.parseInt(evt.getActionCommand().toString());
}//GEN-LAST:event_jrb_bclaveActionPerformed

    private void jbtn_agregarActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jbtn_agregarActionPerformed
        // TODO add your handling code here:
         if(JOptionPane.showConfirmDialog(null, "Desea Agregar Empleado?")==0)
                {
                        this.carga_datos_empleado(12, this.jtf_bidempleado.getText());
                }
    }//GEN-LAST:event_jbtn_agregarActionPerformed

    private void jmni_imprimirhisasiActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jmni_imprimirhisasiActionPerformed
        try {
            // TODO add your handling code here:
            this.jt_historialasistencia.print();
        } catch (PrinterException ex) {
            Logger.getLogger(rh_empleados_prenomina_agregar.class.getName()).log(Level.SEVERE, null, ex);
        }
    }//GEN-LAST:event_jmni_imprimirhisasiActionPerformed
  private void jt_catempleadosMouseClicked(java.awt.event.MouseEvent evt) {
        // TODO add your handling code here:
    }
    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new rh_empleados_prenomina_agregar().setVisible(true);
            }
        });
    }

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup1;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel14;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel4;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel11;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel6;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane10;
    private javax.swing.JScrollPane jScrollPane11;
    private javax.swing.JScrollPane jScrollPane12;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JButton jbtn_agregar;
    private javax.swing.JButton jbtn_buscar;
    private javax.swing.JButton jbtn_guardasolicitud;
    private javax.swing.JCheckBox jchbx_eliminarfila;
    private javax.swing.JCheckBox jchbx_verempleado;
    private javax.swing.JComboBox jcmbox_depart;
    private javax.swing.JComboBox jcmbox_idperiodo;
    private com.toedter.calendar.JDateChooser jdc_fechadocto;
    private com.toedter.calendar.JDateChooser jdc_fechainicio;
    private com.toedter.calendar.JDateChooser jdc_insidenciasfin;
    private com.toedter.calendar.JDateChooser jdc_insidenciasini;
    private com.toedter.calendar.JDateChooser jdc_rangofinal;
    private javax.swing.JLabel jlbl_cantidadregistros;
    private javax.swing.JLabel jlbl_textobuscado;
    private javax.swing.JLabel jlbl_textobuscado1;
    private javax.swing.JList jlst_clientesdistribucion;
    private javax.swing.JMenuItem jmni_escape;
    private javax.swing.JMenuItem jmni_imprimirhisasi;
    private javax.swing.JMenuItem jmni_limpiartabla;
    private javax.swing.JMenuItem jmni_salir;
    private javax.swing.JRadioButton jrb_bclave;
    private javax.swing.JRadioButton jrb_bdescrip;
    private javax.swing.JRadioButton jrb_departamento;
    private javax.swing.JTable jt_catempleados;
    private javax.swing.JTable jt_detalleprenomina;
    private javax.swing.JTable jt_detalleprenomina1;
    private javax.swing.JTable jt_detalleprenomina2;
    private javax.swing.JTable jt_historialasistencia;
    private javax.swing.JTable jt_resumenhistorial;
    private javax.swing.JTable jt_resumenhistorialpuntual;
    private javax.swing.JTextField jtf_bempleadonombre;
    private javax.swing.JTextField jtf_bidempleado;
    private javax.swing.JTextField jtf_busqueda;
    private javax.swing.JTextField jtf_empleadodes;
    private javax.swing.JTextField jtf_observaindica;
    private javax.swing.JTextField jtf_peridodias;
    private javax.swing.JTextField jtf_tituloprenomina;
    // End of variables declaration//GEN-END:variables

}
